#ifndef MYUNIVERSAL_H
#define MYUNIVERSAL_H

#include "MyDefinitions.h"

SDL_Surface *load_image( std::string filename );
//SDL_Surface *load_image( SDL_Surface* );
void apply_surface( int x, int y, SDL_Surface* source, SDL_Surface* destination, SDL_Rect* clip);
int sgn(double);
SDL_Surface* make_fadeout_layer(Uint32 _flags, int _w, int _h, SDL_Color* color1, SDL_Color* color2);
void unload_surface(SDL_Surface*& surface);
SDL_Color* make_color(int,int,int);
SDL_Rect* make_rect(int,int,int,int);
//SDL_Rect* make_rect(double _x, double _y, double _w, double _h);
SDL_Surface* cut_rect(SDL_Surface* from, SDL_Rect* rect);
void display_rect(SDL_Rect* rect, bool _delete);
void display_rect(SDL_Rect* rect);
int further_than_1D(int pos1, int pos2, int dist);
int further_than_2D(int pos1x, int pos1y, int pos2x, int pos2y, int dist);
int getDmg(int _dt, int _ds, int _da);
int oneToXRand(int);
//collide
//SDL surface test if offset (u,v) is a transparent pixel
int SDL_CollideTransparentPixelTest(SDL_Surface *surface , int u , int v);
int SDL_CollidePixel(SDL_Surface *as , int ax , int ay , SDL_Surface *bs , int bx , int by);
//Bounding-box collision between two rectangles, 0 = collision
int SDL_CollideBoundingBox(SDL_Rect *a , SDL_Rect* b);
//tests whether 2 circles intersect, (allow distance between circles of offset)
int SDL_CollideBoundingCircle(int x1, int y1, int r1, int x2, int y2, int r2, int offset);

#endif



